<?php
require_once("config.inc.php");
require_once(INCLUDE_PATH . "db.inc.php");
require_once(INCLUDE_PATH . "user.inc.php");
require_once(INCLUDE_PATH . "blog.inc.php");

ob_start();
session_start();
$blog = new Blog();
$user = new User();

//一级分类设置
$cat1 = $blog->GetCatList(1, 'ee_blog_categories1');
$title = "login";

if($_SERVER['REQUEST_METHOD']=='POST')
{
	if($_SESSION['verify'] == $_POST['verify'])
	{
		if($user->Login($_POST['User'],$_POST['Password'])){
			header("Location:index.php");
			exit();
		}else{
			echo "error user or password";
			exit();
		}
	}else{
		echo "error confirm code!";
		exit();
	}
}
include(TEMPLATE_PATH . "header.php");
?><div id="content" class="full-screen"><div id="login">
<h3>Blog主人登录</h3>
<form id="form1" name="form1" action="" method="post">
<div class="login-form">
	<dl>
    <dt>用户名：</dt>
    <dd><input type="text" class="text" name="User"></dd>
  </dl>
  <dl>
    <dt>密码：</dt>
    <dd><input type="password" class="text" name="Password"></dd>
  </dl>
  <dl>
    <dt>验证码：</dt>
    <dd>
    	<input type="text" class="text" maxlength="4" name="verify" style="width:40px; vertical-align:top">
      <img src="include/GetVerifyImg.php" name="getcode" border="1">
     </dd>
  </dl>
  <dl>
    <dd class="cue"><input type="submit" class="submit" value="登录" style="width:80px; height:33px;"> <!--<a href="register.php">注册</a>--></dd>
  </dl>
</div></form></div></div>
<?php
include(TEMPLATE_PATH . "footer.php");
?>